<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>志愿者主页</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <style>
            body {
                font-family: 'Open Sans', sans-serif;
                line-height: 30px;
                background:url('assets/img/background2.jpg')no-repeat;
                height:100%;
                width:100%;
                overflow: hidden;
                background-size:cover;
            }
            .alp-div {
                filter:alpha(Opacity=90);
                -moz-opacity:0.5;
                opacity: 0.5;
                background-color: #000;
                color:#fff;
                text-align:left;
                padding: 20px;
                position: absolute;
                top: 100px;
                width:420px;
                height:380px;
                left:50%;
                top:50%; 
                margin-left:-210px;
                margin-top:-200px;
                border:1px solid #fff;
            }
            .button-center {
                margin-top: 20px;
                text-align:center;
            }
            .btn {
                width: 250px;
                height: 60px;
                font-size: 20px;
            }
            button:hover{
                color: #2945a5;
            }
        </style>
    </head>
    <body>
        <?PHP
        if (!empty($_GET['email'])) {$email = $_GET['email'];} else {$email = '';}
        $mysqli = mysqli_init();
        $mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 2); //设置超时时间
        $mysqli->real_connect('127.0.0.1', 'root', 'mysql');
        $sql = "CREATE DATABASE IF NOT EXISTS CUPT DEFAULT CHARSET utf8 COLLATE utf8_general_ci;";
        if ($mysqli->query($sql) == TRUE) {
        //printf("Table CUPT successfully created.\n");
        }
        mysqli_select_db($mysqli, "CUPT");

        $sql="select * from volunteer where `email`='$email'";
        $rst = $mysqli->query($sql);
        while ($row = mysqli_fetch_assoc($rst)) {
        $string='';
        $string=$string."<tr><th>Email</th><td>$email</td></tr>";
        $name = $row['name'];
        $string=$string."<tr><th>姓名</th><td>$name</td></tr>";
        $sex = $row['sex'];
        $string=$string."<tr><th>性别</th><td>$sex</td></tr>";
        $volunteer_position = $row['volunteer_position'];
        $string=$string."<tr><th>志愿者职务</th><td>$volunteer_position</td></tr>";
        $work_days = $row['work_days'];
        $string=$string."<tr><th>工作天数</th><td>$work_days</td></tr>";
        $phone_number = $row['phone_number'];
        $string=$string."<tr><th>手机号码</th><td>$phone_number</td></tr>";
        $clothing_model = $row['clothing_model'];
        $string=$string."<tr><th>衣服尺码</th><td>$clothing_model</td></tr>";
        $bank_account=$row['bank_account'];
        $string=$string."<tr><th>银行卡号</th><td>$bank_account</td></tr>";
        }
        ?>
        <div class="alp-div">
            <table width="400" border="1"  cellspacing="0" style="text-align: center;">
                <tr>
                    <th colspan="2">志愿者注册信息</th>
                </tr>
                <?PHP echo $string; ?>
            </table>
            <div class="button-center">
                <a href="volunteer-signup.html?email=<?PHP echo $email;?>"><button class="btn">修改志愿者的注册信息</button></a>
            <div>
        </div> 

    </body>
</html>
